Common Factor Limit Calculator

Problem Derived from a Web Excursion


A linear combination of any two numbers will at some upper limit be able to produce all numbers after that limit. Per the following formula, for any integers a and b, the pair (13,119) can produce all numbers, n, above 1415. In general a and b must be relatively prime.

13 a + 119 b = n

This calculator determines the highest number that cannot be reproduced by a linear combination of the two numbers provided.

This problem was seen on the web (12/9/18). It was solved by trying out various combinations of smaller integers. These pairs gave the following results: (3,5)=>7, (3,7)=>11, (5,7)=>23, (3,11)=>19, (5,11)=>39, and (7,11)=>59. This pattern can be reproduced by the following formula:

CFL = a x b - a + b

I have not proven that this formula will always work, but it is implemented here.




Enter two numbers and hit the button: